<script src="{{ asset('js/jquery-1.8.3.min.js') }}" type="text/javascript"></script>
<link href="{{ asset('css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ asset('css/font-awesome.min.css') }}" rel="stylesheet" />
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<meta name="_token" content="{{csrf_token()}}">
<link rel="stylesheet" href="{{URL::asset('./css/reset.css')}}">
<link rel="stylesheet" href="{{URL::asset('./css/order/sure_order.css')}}">

<!-- home.activity.actPay -->
<div class="main" id="actpay">
    <div class="payheader">
        <a href="{{route('home.index.index') }}">
            <img :src="headerLogo" alt="">
        </a>
        <div class='rightStep'>
            <div class="completed-step active"><a>确认信息</a></div>
            <div class="completed-step"><a>支付金额</a></div>
            <div class="completed-step"><a>购买完成</a></div>
        </div>
    </div>
    <div class="orderMes">
        <p class="checkMes">填写核对订单信息</p>
        <p class="takegoodsMes">收货信息</p>
        <div class="addrMesDiv">
            <p>
                姓名：<span>
                    @{{addressInfo.realname}}

                </span>
            </p>
            <p>
                地址：
                <span>
                    @{{addressInfo.area}}
                    @{{addressInfo.detail}}
                </span>
            </p>
            <p>
                电话：
                <span>
                    @{{addressInfo.phone}}
                </span>
            </p>
            <p>
                <button @click="window.location.href = '{{ route('home.hrmy.hrAddressAdd') }}?addrId='+addressInfo.id">编辑</button>
            </p>
        </div>
    </div>
    <div class="applymes">
        <span>商品信息</span>
        <table>
            <thead>
                <tr>
                    <th colspan="5">供应商：供应商名称</th>
                </tr>
                <tr>
                    <th>
                        订单编号
                    </th>
                    <th>
                        商品名称
                    </th>
                    <th>
                        供应商
                    </th>
                    <th>
                        数量
                    </th>
                    <th>
                        支付金额
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>FUGO3286</td>
                    <td>2017人力资源超级畅销书《HR的未来简史》</td>
                    <td>供应商名称</td>
                    <td>1</td>
                    <td>￥3000.00</td>
                </tr>
            </tbody>
        </table>
    </div>
    <p class="payMony" style="align-items:flex-end">
        商品金额<span>
            ￥6500.00
        </span>
    </p>
    <p class="payMony" style="align-items:flex-end">

        邮费
        <span>
            ￥0.00
        </span>
    </p>

    <div class="submitOrder">
        订单支付<span>
            ￥6500.00
        </span>
        <button @click=" window.location.href = '{{ route('home.order.payOrder') }}'">
            提交订单
        </button>
    </div>

</div>
<script src="{{ asset('js/vue.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/element.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/moment.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/bootstrap.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/public.js') }}" type="text/javascript"></script>
<script>
    $(() => {
        let app = new Vue({
            el: '#actpay',
            data: () => {
                return {
                    headerLogo: '',
                    checkNum: 1,
                    goodsId: getQueryString("goodsId"),
                    goods_type: getQueryString("type"),
                    goods_num: getQueryString("num"),
                    ifcart: getQueryString("ifcart"),
                    addressInfo: {},
                    storeGoodsTotal: {},
                }
            },
            created() {
                this.headerLogo = JSON.parse(sessionStorage.getItem("overall")).site_logo
                this.getDetails();
            },
            mounted() {},
            methods: {
                getDetails() {
                    let orderInfo = [this.goodsId, this.goods_num];
                    let data = {
                        goods_type: this.goods_type,
                        ifcart: this.ifcart,
                        goods_num: this.goods_num,
                        order_info: orderInfo.join()
                    };
                    apiAjax("{{ route('home.order.buyStep1')}}", 'get', data, (res) => {
                        if (res.code == 0) {
                            this.addressInfo = res.data.address_info;
                            this.storeGoodsTotal = res.data.store_goods_total;
                        } else {
                            this.$message({
                                message: res.msg,
                                type: 'warning'
                            });
                        }
                    }, (erro) => {

                    });
                },
            }
        })
    })
</script>